/**
 * @version   $Id: cpanel.js 52 2011-02-09 09:46:59Z happy_noodle_boy $
 * @package   JCE
 * @copyright Copyright (C) 2009 Ryan Demmer. All rights reserved.
 * @license   GNU/GPL
 * This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

(function($) {
    $.Browser = {
        options : {
    		plugin : {
    			plugin	: 'browser',
    			root	: '',
    			site	: '',
    			help	: function() {
	    			window.parent.$jce.createDialog({
	    				src		: 'index.php?option=com_jce&view=help&tmpl=component&section=editor&category=browser',
	    				type	: 'help',
	    				options	: {
	    					width 	: 780,
	    					height	: 560,
	    				}
	    			});
    			}
    		},
    		manager : {
    			upload : {
    				insert : false
    			}
    		}
    	},
    		
    	init : function(options) {    		
    		$.extend(true, this.options, options);
    		
    		$('<input type="hidden" id="src" value="" />').appendTo(document.body);
    		
    		$.Plugin.init(this.options.plugin);
    		
    		$('button#insert, button#cancel').hide();
    		
    		// Create File Browser
            WFFileBrowser.init($('#src'), this.options.manager || {});
        }
    }
})(jQuery);

//fake tinyMCE object for language files
var tinyMCE = {
	addI18n : function(p, o) {	
		return $.Plugin.addI18n(p, o);
	}
};